import React, { useState } from "react";
import { View, Button } from "@tarojs/components";
import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
import "./style.less";

export default (props) => {
  return (
    <View className="modal">
      <AtModal
        isOpened={props.isOpened}
        className="modalWrapp"
        onClose={props.onClose}
      >
        <AtModalHeader>{props.title}</AtModalHeader>
        <AtModalContent>{props.children}</AtModalContent>
        <AtModalAction>
          <Button className="clearBtn" onClick={props.cancelCall}>
            取消
          </Button>
          <Button className="saveBtn" onClick={props.okCall}>
            确定
          </Button>
        </AtModalAction>
      </AtModal>
    </View>
  );
};
